package com.xmy.study.mapper;

import com.xmy.study.entity.Task;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 任务表 Mapper 接口
 * </p>
 *
 * @author Helin
 * @since 2024-03-18
 */
public interface TaskMapper extends BaseMapper<Task> {
    @Select("select `id`, `year_part`, `quarter_num`, `year_class_id`, `subjects_id`, `class_type_id`, `course_version_id`, `start_task_date`, `task_date`, MAX(`task_course_num`) as `task_course_num`, `lowest_shutnum`, `break_shutnum`, `deleted`, `created_at`, `updated_at` from edu_task where year_part = ${yearPart} and quarter_num = ${quarterNum} and course_version_id= ${courseVersionId} and subjects_id IN (${subjectsId}) and task_category_id = ${categoryId} and deleted = 0 limit 1")
    public Task getTaskOneBackTaskNum(@Param("yearPart") String yearPart, @Param("quarterNum") String quarterNum, @Param("courseVersionId") Long courseVersionId, @Param("subjectsId") String subjectsId, @Param("categoryId") Integer categoryId);


}
